home *** CD-ROM | disk | FTP | other *** search
/ The Best of MacTutor - S…e Code for Volumes 1 to 5 / The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin / Source Code / #34 (Jul 88) / Resource Roundup / PolyTest.a
Text File  |  1988-06-10  |  1KB  |  71 lines

  1. ; Sample program to crash QuickDraw with Polygon operation
  2. ; Original by Jean-Paul Harmand
  3. ; Transcribed to MPW by Joel West for MacTutor, 6/10/88
  4. ;
  5. ; Build using:
  6. ;    CreateMake PolyTest PolyTest.a
  7. ;    BuildProgram PolyTest
  8. ;
  9.     Print    OFF
  10.     Include    'Traps.a'
  11. ;    Include    'ToolEqu.a'
  12.     Include    'QuickEqu.a'
  13. ;    Include    'SysEqu.a'
  14.     Print    ON
  15.  
  16. QuickDraw    RECORD        ,DECREMENT
  17. thePort     DS.L        1
  18. white        DS.B        8
  19. black        DS.B        8
  20. gray        DS.B        8
  21. ltGray        DS.B        8
  22. dkGray        DS.B        8
  23. arrow        DS.B        cursRec
  24. screenBits    DS.B        bitmapRec
  25. randSeed    DS.L        1
  26.         ORG         -grafSize
  27.         ENDR
  28.  
  29.  
  30.     MAIN
  31. PolyLen    EQU    $001E
  32.  
  33.     WITH    QuickDraw
  34.     PEA             thePort 
  35.     _InitGraf
  36.     _InitFonts
  37.     _InitWindows
  38.     _InitMenus
  39.     CLR.L    -(SP)
  40.     _InitDialogs
  41.     _TEInit
  42.     _InitCursor
  43.     MOVE.L    #PolyLen,D0
  44.     _NewHandle
  45.  
  46.     MOVE.L    A0,A2
  47.     MOVE.L    (A0),A0
  48.     LEA    PolyValues,A1
  49.     MOVE.W    #PolyLen/2,D0
  50. @1    MOVE.W    (A1)+,(A0)+
  51.     DBRA    D0,@1
  52.     
  53.     MOVE.L    A2,-(SP)
  54.     PEA    WhitePattern
  55.     _FillPoly
  56.     _ExitToShell
  57.  
  58. WhitePattern
  59.     DC.L    0,0
  60. PolyValues
  61.     DC.W    PolyLen
  62.     DC.W    $FD20,$FDC3,$165C,$07EE
  63.     DC.W    $165C,$07EE
  64.     DC.W    $1170,$02B4
  65.     DC.W    $02FF,$0021
  66.     DC.W    $FD20,$FDC3
  67.     DC.W    $165C,$07EE
  68.     ENDMAIN
  69.  
  70.     END
  71.